package com.woniuxy.main.service.imp;


import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.woniuxy.main.mapper.CoachMapper;
import com.woniuxy.main.mapper.StudentMapper;
import com.woniuxy.main.mapper.UserMapper;
import com.woniuxy.main.pojo.Student;
import com.woniuxy.main.pojo.Vi_user_student;
import com.woniuxy.main.service.StudentService;

import lombok.Data;

@Data
@Service
@Transactional
public class StudentServiceImp implements StudentService{

	@Resource
	private StudentMapper studentMapper;
	@Resource
	private CoachMapper coachMapper;
	@Resource
	private UserMapper userMapper;

	@Override	//查询学员sid
	public int findSidByUid(int uid) {
		return studentMapper.findSidByUid(uid);
	}

	@Override	//根据学员id查学员个人信息
	public Student findStudentBySid(int sid) {
		return studentMapper.findStudentBySid(sid);
	}

	@Override
	public int findOrderCount(int sid) {
		return studentMapper.findOrderCount(sid);
	}

	@Override
	public int findPositiveCount(int sid) {
		return studentMapper.findPositiveCount(sid);
	}

	@Override
	public int insertStudent(int uid) {
		return studentMapper.insertStudent(uid);
	}

	@Override
	public List<Vi_user_student> findAllStudent() {
		return studentMapper.findAllStudent();
	}

}
